package org.java.user.controller;

import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;

@RestController
@RequestMapping("user-info")
public class UserInfoController {
    @GetMapping
    public Principal get(@AuthenticationPrincipal Principal principal) {
        System.out.println(principal);
        return principal;
    }


}
